package com.ex2.client;

import com.ex2.publish.ConcreteSubject;
import com.ex2.subscribe.ConcreteObserver;
import com.ex2.subscribe.Observer;
/**
 * pull观察者模式
 */
public class Client {
	public static void main(String[] args) {
		// 创建主题对象
		ConcreteSubject subject = new ConcreteSubject();
		// 创建观察者对象
		Observer observer = new ConcreteObserver();
		// 将观察者对象登记到主题对象上
		subject.attach(observer);
		// 改变主题对象的状态
		subject.change("new state");
	}
}
